/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package replica_manager_ws;

import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import replica_manager_core.ReplicaManagerCore;

/**
 *
 * @author iMarshall
 */
@WebService()
public class ReplicaManagerWS {
    @EJB
    private ReplicaManagerCore ejbRef;

    @WebMethod(operationName = "retrieveReplica")
    public boolean retrieveReplica() {
        return ejbRef.retrieveReplica();
    }

    @WebMethod(operationName = "submitReplica")
    public boolean submitReplica(@WebParam(name = "resource")
    String resource) {
        return ejbRef.submitReplica(resource);
    }

    @WebMethod(operationName = "getReplica")
    public boolean getReplica(@WebParam(name = "tID")
    String tID) {
        return ejbRef.getReplica(tID);
    }

    @WebMethod(operationName = "transmitReplica")
    public String transmitReplica(@WebParam(name = "tID")
    String tID) {
        return ejbRef.transmitReplica(tID);
    }

    @WebMethod(operationName = "pushReplica")
    public boolean pushReplica(@WebParam(name = "resource")
    String resource, @WebParam(name = "tID")
    String tID) {
        return ejbRef.pushReplica(resource, tID);
    }

    @WebMethod(operationName = "rollBack")
    public boolean rollBack(@WebParam(name = "tID")
    String tID) {
        return ejbRef.rollBack(tID);
    }

    @WebMethod(operationName = "canCommit")
    public boolean canCommit(@WebParam(name = "tID")
    String tID)
    {
        return ejbRef.canCommit(tID);
    }

    @WebMethod(operationName = "doCommit")
    public boolean doCommit(@WebParam(name = "tID")
    String tID)
    {
        return ejbRef.doCommit(tID);
    }
}
